package com.zhanggm.student.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@Component
public class LoginInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String requestURI = request.getRequestURI();
        final String pageNum = request.getParameter("pageNum");
        String userAgent = request.getHeader("User-Agent");
        log.info("url:{},params:{}",request.getRequestURI(),request.getParameterMap());
        return true;
    }
}
